package com.mall.course.courseSignup.service.impl;

import java.util.List;
import com.mall.common.utils.DateUtils;
import com.mall.course.courseSignup.domain.dto.CourseSignupDto;
import com.mall.course.courseSignup.domain.vo.CourseSignupVo;
import com.mall.course.courseSignup.mapper.CourseSignupMapper;
import com.mall.course.courseSignup.service.ICourseSignupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 课程报名Service业务层处理
 * 
 * @author mall
 * @date 2024-05-17
 */
@Service
public class CourseSignupServiceImpl implements ICourseSignupService
{
    @Autowired
    private CourseSignupMapper courseSignupMapper;

    /**
     * 查询课程报名
     * 
     * @param id 课程报名主键
     * @return 课程报名
     */
    @Override
    public CourseSignupVo selectCourseSignupById(Long id)
    {
        return courseSignupMapper.selectCourseSignupById(id);
    }

    /**
     * 查询课程报名列表
     * 
     * @param courseSignupDto 课程报名
     * @return 课程报名
     */
    @Override
    public List<CourseSignupVo> selectCourseSignupList(CourseSignupDto courseSignupDto)
    {
        return courseSignupMapper.selectCourseSignupList(courseSignupDto);
    }

    /**
     * 新增课程报名
     * 
     * @param courseSignupDto 课程报名
     * @return 结果
     */
    @Override
    public int insertCourseSignup(CourseSignupDto courseSignupDto)
    {
        courseSignupDto.setCreateTime(DateUtils.getNowDate());
        return courseSignupMapper.insertCourseSignup(courseSignupDto);
    }

    /**
     * 修改课程报名
     * 
     * @param courseSignupDto 课程报名
     * @return 结果
     */
    @Override
    public int updateCourseSignup(CourseSignupDto courseSignupDto)
    {
        courseSignupDto.setUpdateTime(DateUtils.getNowDate());
        return courseSignupMapper.updateCourseSignup(courseSignupDto);
    }

    /**
     * 批量删除课程报名
     * 
     * @param ids 需要删除的课程报名主键
     * @return 结果
     */
    @Override
    public int deleteCourseSignupByIds(Long[] ids)
    {
        return courseSignupMapper.deleteCourseSignupByIds(ids);
    }

    /**
     * 删除课程报名信息
     * 
     * @param id 课程报名主键
     * @return 结果
     */
    @Override
    public int deleteCourseSignupById(Long id)
    {
        return courseSignupMapper.deleteCourseSignupById(id);
    }
}
